package businessLogic.service;

import dao.BilleteraDAO;
import entity.Billetera;
import java.util.List;
import javax.persistence.EntityManager;
import vo.BilleteraVO;
import vo.IValueObject;

/**
 *
 * @author Alexander
 */
public class BilleteraService implements IService{

    @Override
    public void persist(IValueObject vo, EntityManager em) {
        Billetera entity = new Billetera();
        entity.setId(((BilleteraVO)vo).getId());
        
        new BilleteraDAO().persist(entity, em);
    }

    @Override
    public IValueObject find(Object id, EntityManager em) {
        return new BilleteraDAO().find(id, em);
    }

    @Override
    public void update(IValueObject vo, EntityManager em) {
        Billetera entity = new Billetera();
        entity.setId(((BilleteraVO)vo).getId());
        
        new BilleteraDAO().update(entity, em);
    }

    @Override
    public void delete(Object id, EntityManager em) {
        new BilleteraDAO().delete(id, em);
    }

    @Override
    public List<IValueObject> getList(EntityManager em) {
        return new BilleteraDAO().getList(em);
    }
    
}
